home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / emacs / !uE311_cmd_EmacsRC < prev    next >
Encoding:
Text File  |  1991-06-27  |  6.2 KB  |  303 lines

  1. ;    EmacsRC for the Archimedes desktop version
  2.  
  3. set $discmd FALSE
  4. write-message "[Setting up....]"
  5.  
  6. ; If you screen "SNOWS", comment this line
  7.     set $flicker "FALSE"
  8.  
  9. ; To use an IBM-PC EGA card, uncomment the following line
  10. ;    set $sres "EGA"
  11.  
  12. ;    ***** Rebind the Function key group
  13.  
  14. bind-to-key i-shell            FN1
  15. bind-to-key find-file            FN2
  16. bind-to-key save-file            FN3
  17. bind-to-key search-forward        FN4
  18. bind-to-key goto-line            FN5
  19. bind-to-key set-mark            FN6
  20. bind-to-key next-window            FN7
  21.  
  22. bind-to-key execute-macro-10        S-FN1
  23. bind-to-key execute-macro-11        S-FN2
  24. bind-to-key execute-macro-12        S-FN3
  25. bind-to-key execute-macro-13        S-FN4
  26. bind-to-key execute-macro-14        S-FN5
  27. bind-to-key execute-macro-15        S-FN6
  28. bind-to-key execute-macro-16        S-FN7
  29. bind-to-key execute-macro-17        S-FN8
  30. bind-to-key execute-macro-18        S-FN9
  31. bind-to-key execute-macro-19        S-FN0
  32.  
  33. bind-to-key beginning-of-file        FN^P  ; Ctl-Up
  34. bind-to-key end-of-file            FN^N  ; Ctl-Down
  35. bind-to-key beginning-of-line        FN^B  ; Ctl-Left
  36. bind-to-key end-of-line            FN^F  ; Ctl-Right
  37.  
  38. bind-to-key previous-page        S-FNP ; Shift-Up
  39. bind-to-key next-page            S-FNN ; Shift-Down
  40. bind-to-key previous-word        S-FNB ; Shift-Left
  41. bind-to-key next-word            S-FNF ; Shift-Right
  42.  
  43. bind-to-key next-page            FNW    ; Scroll bar down click
  44. bind-to-key previous-page        FNZ    ; Scroll bar up click
  45. bind-to-key next-line            FNX    ; Scroll button down click
  46. bind-to-key previous-line        FNY    ; Scroll button up click
  47.  
  48. bind-to-key execute-macro-22        FN^>  ; Ctl-Copy: Delete line
  49. bind-to-key execute-macro-23        FNC   ; Insert: Swap insert<>overtype
  50.  
  51. bind-to-key delete-next-character    FN>   ; Copy
  52.  
  53. bind-to-key execute-named-command    A-X
  54. bind-to-key apropos            A-A
  55.  
  56. ;    Set Default Global modes
  57.  
  58. add-global-mode "blue"
  59.  
  60. ;    Toggle function key window display
  61.  
  62. 1    store-macro
  63.     !if %rcfkeys
  64.         !goto rcfoff
  65.     !endif
  66.  
  67. ;    toggle function key window on
  68.     save-window
  69.     1 next-window
  70.     !if &sequal $cbufname "help"
  71.         delete-window
  72.     !endif
  73.     !if ¬ &sequal $cbufname "Function Keys"
  74.         1 split-current-window
  75.         1 select-buffer "Function Keys"
  76.         add-mode "red"
  77.         !force 5 resize-window
  78.         1 goto-line
  79.     !endif
  80.     set %rcfkeys TRUE
  81.     !force restore-window
  82.     !if &sequal $cbufname "Function Keys"
  83.         next-window
  84.     !endif
  85.     write-message "[Function key window ON]"
  86.     !return
  87.  
  88.     ;Toggle the function key window off
  89. *rcfoff
  90.     save-window
  91.     1 next-window
  92.     !if &sequal "Function Keys" $cbufname
  93.         delete-window
  94.     !endif
  95.     !force restore-window
  96.     write-message "[Function key window OFF]"
  97.     set %rcfkeys FALSE
  98. !endm
  99.  
  100. ;    Toggle HELP file onscreen
  101.  
  102. 2 store-macro
  103.     1 next-window
  104.  
  105.     ;Make sure the function key window isn't up!
  106.     !if &sequal $cbufname "Function Keys"
  107.         delete-window
  108.     !endif
  109.     set %rcfkeys FALSE
  110.  
  111.     ;Bring up page 1
  112.     !if ¬ &seq $cbufname "help"
  113.         help
  114.         8 resize-window
  115.         add-mode "red"
  116.         beginning-of-file
  117.         2 forward-character
  118.     !endif
  119.  
  120. *rchelp
  121.  
  122.     write-message "[PgUp/PgDn] Page    [FN6] EXIT     ^G  Exit leaving page on screen"
  123.     update-screen
  124.     set %rctmp >cmd
  125.     !if &seq %rctmp FNZ
  126.         beginning-of-line
  127.         !force search-reverse "=>"
  128.         1 redraw-display
  129.         !goto rchelp
  130.     !endif
  131.     !if &seq %rctmp FNV
  132.         beginning-of-line
  133.         2 forward-character
  134.         !force search-forward "=>"
  135.         1 redraw-display
  136.         !goto rchelp
  137.     !endif
  138.     !if &seq %rctmp FN6
  139.         delete-window
  140.         !if &seq %rcfkeys TRUE
  141.             set %rcfkeys FALSE
  142.             execute-macro-1
  143.         !endif
  144.         write-message "[Help Exited]"
  145.         !return
  146.     !endif
  147.     !if &seq %rctmp ^G
  148.         next-window
  149.         set %rcfkeys FALSE
  150.         write-message "[Help Aborted]"
  151.         !return
  152.     !endif
  153.     !goto rchelp
  154. !endm
  155.  
  156. ;    Load a new page
  157.  
  158. 3    store-macro
  159.     !if &seq &find newpage ""
  160.         write-message "[Cannot find NEWPAGE]"
  161.         !return
  162.     !endif
  163.     execute-file newpage
  164. !endm
  165.  
  166. ;procedure to clean out the current page (which is nothing right now)
  167.  
  168. store-procedure    clean
  169.     ; nothing by default
  170. !endm
  171.  
  172. ;    Set up auto CMODE
  173.  
  174. 20    store-macro
  175.     set %rctmp  &length $cfname
  176.  
  177.     !while &greater %rctmp 0
  178.         !if &seq  "."  &mid $cfname %rctmp 1
  179.             !break
  180.         !endif
  181.         set %rctmp  &sub %rctmp 1
  182.     !endwhile
  183.  
  184. ;    No directory at all...
  185.     !if &less %rctmp 2
  186.         !return
  187.     !endif
  188.  
  189.     !if &equ %rctmp 2
  190.  
  191. ;        Dir must be "c" or "h"
  192.         set %rctmp &lower &left $cfname 1
  193.  
  194.         !if &or  &seq "c" %rctmp  &seq "h" %rctmp
  195.             add-mode "cmode"
  196.         !endif
  197.     !else
  198.  
  199. ;        Char befor dir must be "." or ":"
  200.         !if ¬ &sin   ".:"   &mid $cfname  &sub %rctmp 2  1
  201.             !return
  202.         !endif
  203.  
  204. ;        Dir must be "c" or "h"
  205.         !if ¬ &sin   "cChH"   &mid $cfname  &sub %rctmp 1  1
  206.             !return
  207.         !endif
  208.  
  209.         add-mode "cmode"
  210.     !endif
  211.  
  212. !endm
  213. set $readhook execute-macro-20
  214.  
  215. ;    This function activates the function key window as
  216. ;    a legitimate place to call up function keys
  217.  
  218. 21    store-macro
  219.  
  220.     ;remember where we started, and do the mouse movement
  221.     save-window
  222.     mouse-move-down
  223.  
  224.     ;If not in the function key window... leave
  225.     !if ¬ &sequal $cbufname "Function Keys"
  226.         !return
  227.     !endif
  228.  
  229.     ;Find out what function key were gonna do
  230.     add-mode magic
  231.     2 forward-character
  232.     set %rctmp $search
  233.     !force search-reverse "[fF][0-9]"
  234.     !if &seq $status FALSE
  235.         delete-mode magic
  236.         set $search %rctmp
  237.         !return
  238.     !endif
  239.  
  240.     ;we are on the "f" or "F".  Get the function key type and number now
  241.     set $search %rctmp
  242.     set %fcase lower
  243.     !if &equ $curchar 70
  244.         set %fcase upper
  245.     !endif
  246.     1 forward-character
  247.     set %fnum &chr $curchar
  248.     1 forward-character
  249.     set %fnum &cat %fnum &chr $curchar
  250.     set %fnum &add %fnum 0
  251.     !if &equ %fnum 10
  252.         set %fnum "0"
  253.     !endif
  254.     set %fname &cat "FN" %fnum
  255.     !if &seq %fcase upper
  256.         set %fname &cat "S-" %fname
  257.     !endif
  258.  
  259.     ;save the function
  260.     set %rccmd &bind %fname
  261.     delete-mode MAGIC
  262.  
  263.     ;swallow the up-button
  264.     set %rctmp >c
  265.  
  266.     ;restore the window and exit
  267.     restore-window
  268.  
  269.     ;and then execute it
  270.     execute-named-command &ind %rccmd
  271. !endm    
  272. bind-to-key execute-macro-21 MSa
  273.  
  274. ;    Delete a line
  275.  
  276. 22    store-macro
  277.     !if &greater $curcol 0
  278.         beginning-of-line
  279.     !endif
  280.     !force 1 kill-to-end-of-line
  281. !endm
  282.  
  283. ;    Swap insert<>overtype
  284.  
  285. 23    store-macro
  286.     set $cmode &bxor $cmode 32
  287. !endm
  288.  
  289. ;    bring up the function key window
  290.  
  291.     1 split-current-window
  292.     1 select-buffer "Function Keys"
  293.     insert-string "f1 search-> f2 <-search |    MicroEMACS:  Text Editor~n"
  294.     insert-string "f3 hunt->   f4 <-hunt   | ~n"
  295.     insert-string "f5 fkeys    f6 help     |  Available function key Pages include:~n"
  296.     insert-string "f7 nxt wind f8 pg[    ] |    WORD  BOX  EMACS  PASCAL  C   COBOL~n"
  297.     insert-string "f9 save     f10 exit    |  [use the f8 key to load Pages]~n"
  298.     unmark-buffer
  299.     delete-window
  300.     set %rcfkeys TRUE
  301.     execute-macro-1
  302.     set $discmd TRUE
  303.